/*** 用于向前台AJAX调用时，从response 写入json  **/

package cn.collin.commons.utils;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class JsonWriter {
public	static void write(HttpServletResponse response, String content)
			throws  RuntimeException {
		response.setContentType("text/xml;charset=UTF-8");
		PrintWriter out;
		try {
			out = response.getWriter();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		try {
			out.print(content);
		} finally {
			out.close();
		}
	}
}
